Repository navigation
Fix embedded browser click focus handoff across Linux, macOS, and Windows - #1631
Merged
Merged
Conversation
…dows Clicking a text field in the embedded CEF browser could leave keyboard focus with Backplane because: - on_got_focus never consulted button_down() when pressed_in() was unwatched (Windows and macOS), and single-consume press records dropped paired on_set_focus/on_got_focus callbacks across intervening pump() ticks; - CefPage's independent want_focus/want_yank booleans allowed unclicked on_got_focus, background tabs, or cross-tab switches to yank or mis-blur focus; - macOS focus_child unconditionally reset firstResponder on the outer wrapper view even when an inner Chromium view held focus, and lacked pre-dispatch click recording. Add a pure cross-platform FocusHandoff/PressTracker state machine (viewers/cef_focus.rs) with sequence-ordered press/cutoff tracking and unit tests, hook Windows (WH_MOUSE + WH_CALLWNDPROC WM_MOUSEACTIVATE deduplication) and macOS (GPUIApplication -sendEvent: + AppKit hitTest: + arch-exact ObjCBool) mouse-down events, preserve inner NSView firstResponder on macOS, handle window deactivation and inactive handback cleanly, and wire CefPage/Tab through RenderFocusPlan. Fixes #1595
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clicking a text field in the embedded CEF browser could leave keyboard focus with Backplane because:
Add a pure cross-platform FocusHandoff/PressTracker state machine (viewers/cef_focus.rs) with sequence-ordered press/cutoff tracking and unit tests, hook Windows (WH_MOUSE + WH_CALLWNDPROC WM_MOUSEACTIVATE deduplication) and macOS (GPUIApplication -sendEvent: + AppKit hitTest: + arch-exact ObjCBool) mouse-down events, preserve inner NSView firstResponder on macOS, handle window deactivation and inactive handback cleanly, and wire CefPage/Tab through RenderFocusPlan.
Fixes #1595